#ifndef ARCHPAGER_H_
#define ARCHPAGER_H_

/*
 *
 */
#include <Object.h>

#include <kiddie/kiddie.h>
#include <sys/types.h>
#include <arm/mach/platform.h>
#include <arm/platform.h>
#include <mem/MemTypes.h>

namespace kernel {
namespace mem {
//namespace page {

#if 0
/**
 * memory
 */
class MemArea
{
public:
	MemArea() {}
	MemArea(vaddr_t v,size_t l) : v_addr(v), length(l) {}
	MemArea(paddr_t p, vaddr_t v,size_t l) : p_addr(p), v_addr(v), length(l) {}
	~MemArea() {}
	MemArea *prev;
	MemArea *next;
	vaddr_t v_addr;	/* virtual address */
	size_t length;	/* length in bytes */
	vaddr_t p_addr;	/* phys address of area */
};
#endif

class ArchVmMap
{
public:
    ArchVmMap () : pgd(0) {}
    ArchVmMap &operator= (ArchVmMap &_from);
    virtual ~ArchVmMap() {}

    vaddr_t archMapArea(MemArea &area);

//    vaddr_t mapPage(paddr_t paddr, vaddr_t vaddr);
//    vaddr_t mapPage(vaddr_t vaddr);
    void setPgd(pgd_t p)
    {
        pgd = p;
    }
    void setPageFactory(page::PageFactory *pNod)
    {
        pNode = pNod;
    }

//protected:
    pgd_t getPgd()
    {
        return pgd;
    }

private:
    pgd_t	pgd;
    page::PageFactory *pNode;
	pgd_t __alloc_pgd(void);
};


}
}
//}

#endif /*ARCHPAGER_H_*/
